package com.young4j.springdemo.service.Impl;

import com.young4j.springdemo.domain.Student;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;

/**
 * @Description
 * @Author yf
 * @Date 2018/12/26 14:20
 **/
@Service
public class TestStudentServiceImpl implements com.young4j.springdemo.service.TestStudentService {
    @Override
    public List<Student> listTest() {
        List<Student> ret = new ArrayList<>();
        Random r = new Random();
        List<Long> collect = r.longs(1000L, 9999L).limit(2).boxed().collect(Collectors.toList());
        collect.forEach(n ->{
            Student student = new Student(n, Long.toString(n));
            ret.add(student);
        });
        return ret;
    }
}
